<?php

use Illuminate\Database\Seeder;

class PermitSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        \App\Models\RolePermit::truncate();
        //添加超级管理员权限
        $data = [];
        for ($i = 1; $i <= 20; ++$i) {
            $data[] = ['role_id' => 1, 'permit_id' => $i];
        }
        \App\Models\RolePermit::insert($data);

        //添加老板权限
        $data = [
            ['role_id' => 2, 'permit_id' => 1],
            ['role_id' => 2, 'permit_id' => 2],
            ['role_id' => 2, 'permit_id' => 5],
            ['role_id' => 2, 'permit_id' => 6],
            ['role_id' => 2, 'permit_id' => 7],
            ['role_id' => 2, 'permit_id' => 8],
            ['role_id' => 2, 'permit_id' => 9],
            ['role_id' => 2, 'permit_id' => 10],
        ];
        \App\Models\RolePermit::insert($data);
    }
}
